<template>
  <div class="overWarning_wrap">
    <!-- 数据展示 -->
    <el-table
      :data="tableData"
      :header-cell-style="{background:'#f0f3fa',textAlign:'center'}"
      style="width: 100%"
      :row-class-name="tableRowClassName"
      :cell-style="{textAlign:'center'}"
    >
      <el-table-column prop="companyName" label="公司名称"></el-table-column>
      <el-table-column prop="companyTypeName" label="单位类型"></el-table-column>
      <el-table-column prop="waterTypeName" label="用水类型"></el-table-column>
      <el-table-column prop="totalWater" label="计划用水量"></el-table-column>
      <el-table-column prop="totalWater" label="实际用水量"></el-table-column>
      <el-table-column>
        <template slot-scope="scope">
          <span class="bule" @click="handleEdit(scope.row)">查看详情</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { waterWarningRecordList } from '@/api/other'
export default {
  data() {
    return {
      dataForm: {
        page: 1,
        pageSize: 10,
        createDateStart: this.ShowDate(90) + ' 00:00:00',
        createDateEnd: this.ShowDate(0) + ' 23:59:59',
      },
      tableData: [],
    }
  },
  mounted() {
    this.waterWarningRecordListReq()
  },
  methods: {
    waterWarningRecordListReq() {
      waterWarningRecordList(this.dataForm).then((res) => {
        const { code, data, msg } = res
        if (code !== '0000') return this.$message.error(msg)
        const { list } = data
        this.tableData = list
      })
    },
    handleEdit() {
      this.$router.push({
        path: 'earlyWarning/earlyWarningHistory',
      })
    },
  },
}
</script>

<style lang='scss' scoped>
.overWarning_wrap {
  height: 240px;
  overflow: auto;
}
</style>
